﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TYPLC
{
    public class TagPara
    {
        public TagPara(string tagName, string address, int index, PLCDataType dataType, int count = 1)
        {
            TagName = tagName;
            TagAddress = address;
            TagIndex = index;

            if (count <= 1)
            {
                TagLength = 1;
            }
            else
            {
                TagLength = count;
            }

            DataType = dataType;
        }

        public string TagName { get; private set; }
        public string TagAddress { get; private set; }
        public int TagLength { get; private set; } = 1;
        public int TagIndex { get; private set; } = 1;
        public PLCDataType DataType { get; private set; }
    }

    public enum PLCDataType
    {
        BOOL,
        INT,
        BYTE,
        FLOAT,
        String,
    }
}